<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 取一对数组的最大值
    let arr =[2,34,21,5,23,55,90]
    // max用来装最大值
    let max =0
    for (let i = 0; i < arr.length;i++){
      // 作比较 
      // 如果max大于arr[i]就存max本身
      if (max > arr[i]){
        max = max
      }else {
        // 如果max小于arr[i]就存arr[]
        max = arr[i]
      }
    }
    alert(max)
    console.log(max)
  </script>
</body>
</html>